$(function() {
	$("#myForm").Validform({
		btnSubmit: ".zc",
		tiptype: 4,
		callback: function(data) {
			var loginname=app.account.loginname;
			var password=app.account.password;
			var email=app.account.email;
			var sex=app.account.sex;
			var username=app.account.username;
			var phone=app.account.phone;

			var data=new URLSearchParams();
			data.append("loginname",loginname);
			data.append("password",password);
			data.append("email",email);
			data.append("sex",sex);
			data.append("username",username);
			data.append("phone",phone);
			axios.post("/yly-api/user/register",data).then(
				function(res) {
					console.log(res);
					if (res.data.code==200){
						alert(res.data.data);
						location.href="../index.html"
					}else if (res.data.code==500){
						location.href="../500.html";
					}
				}
			);
			return false;
		}
	});
})
